//
//  HRUserGoodListTableViewCell.m
//  haierapp
//
//  Created by Xia Zhiyong on 14-8-12.
//  Copyright (c) 2014年 haier. All rights reserved.
//

#import "HRUserGoodsListTableViewCell.h"
#import "HROrderProductInfo.h"

@implementation HRUserGoodsListTableViewCell

- (void)awakeFromNib
{
    // Initialization code
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = (HRUserGoodsListTableViewCell *)[[[NSBundle mainBundle] loadNibNamed:@"HRUserGoodsListTableViewCell"
                                                                        owner:self
                                                                      options:nil] objectAtIndex:0];
    return self;

}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)configWithData:(id)data{
    HROrderProductInfo *product=(HROrderProductInfo *)data;
    
    NSURL *imgUr=[NSURL URLWithString:product.productLinker];
    
    [self.imgIcon setImageWithURL:imgUr placeholderImage:[UIImage imageNamed:IMAGENAME_PLACE_HODLE]];
    self.lblName.text=product.productTitle;
    
    NSString *productParam=@"";
    //产品规格
    for (HRProSpeInfo *param in product.productClassify) {
        productParam=[NSString stringWithFormat:@"%@%@;%@",param.name,param.value,productParam];
    }
    self.lblType.text=productParam;
    
    self.lblPrice.text=[NSString stringWithFormat:@"￥%@",product.unitPrice];
    
    
    self.lblName.text=[NSString stringWithFormat:@"×%@",product.productNum];
}

@end
